package com.javaclimb.music.service.impl;

import com.javaclimb.music.mapper.LoginMapper;
import com.javaclimb.music.po.Admin;
import com.javaclimb.music.po.Consumer;
import com.javaclimb.music.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {
    @Autowired
    private LoginMapper mapper;

    @Override
    public boolean IsLogin(Admin admin) {
        return mapper.IsLogin(admin)>0;
    }

    @Override
    public int CreateAdmin(Admin admin) {
        return mapper.saveAdmin(admin);
    }

    @Override
    public boolean IsUserLogin(Consumer consumer) {
        return mapper.IsUserLogin(consumer)>0;
    }
}
